package com.jokins.admin.vue.gitlog.service.impl;

import com.jokins.admin.vue.gitlog.actioncontext.GetApplyListDoc;
import com.jokins.admin.vue.gitlog.actioncontext.SaveApplyDoc;
import com.jokins.admin.vue.gitlog.param.ApplyParam;
import com.jokins.admin.vue.gitlog.param.SaveApplyParam;
import com.jokins.admin.vue.gitlog.service.ApplyService;
import com.jokins.admin.vue.gitlog.vo.ApplyVo;
import com.jokins.common.actions.action.ActionContext;
import com.jokins.common.actions.util.ActionDispatcher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class ApplyServiceImpl implements ApplyService {

    @Override
    public List<ApplyVo> getApplyList(ApplyParam param) {
        GetApplyListDoc doc = new GetApplyListDoc(param);
        ActionDispatcher.execute(doc);
        return (List<ApplyVo>) doc.getResultValue(ActionContext.RESULT_DOC_KEY);
    }

    @Override
    public void saveApply(SaveApplyParam param) {
        SaveApplyDoc doc = new SaveApplyDoc(param);
        ActionDispatcher.execute(doc);
    }
}
